package com.example.demo.reflect;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.json.JSONUtil;

import java.lang.reflect.Modifier;
import java.util.HashMap;

/**
 * <pre>
 *  描述:
 * </pre>
 *
 * @author godelgnis(wujiaer)
 * @version 1.0.0
 * @date 2022/3/3 8:56
 */
public class ReflectTest {


    public static void main(String[] args) {
        //JSONUtil.toBean();
        //ClassUtil.
        System.out.println(ClassUtil.getDeclaredField(Student.class, "info").getGenericType().getTypeName());
        Student student = ReflectUtil.newInstanceIfPossible(Student.class);
        //Object o = ReflectUtil.newInstanceIfPossible((Class<?>) new TypeReference<Info<String>>() {}.getType());
        //BeanUtil
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        objectObjectHashMap.computeIfAbsent("k", null);

    }


}
